﻿// ....................................................................................................................
//	Author: Copyright (C) 2012 Ing. Marek Hubal
//	Email: hubal@acasoftware.org
// ....................................................................................................................

using System;

namespace core
{

    /// <summary>Trieda IVisualStyle</summary>
    public class IVisualStyle : IDisposable
    {
        public static string DefaultFontName;
        public static double DefaultFontSize;

        public bool UseFont; // Priznaky pouzitia
        public bool UseBackColor;
        public bool UseForeColor;
        public bool UseLook3D;

        public string FontName; // Nazov fontu
        public double FontSize; // Velkost fontu
        public bool FontBold; // Priznak bold fontu
        public bool FontItalic; // Priznak utalic fontu
        public System.Drawing.Color BackColor; // Farba pozadia
        public System.Drawing.Color ForeColor; // Farba fontu
        public bool Look3D; // Priznak 3D vzhladu

        protected System.Drawing.Font FFont; // objekt fontu

        /// <summary>Property: Font</summary>
        public System.Drawing.Font Font
        {
            get
            {
                if (FFont == null) // Font este nie je vytvoreny?
                {
                    System.Drawing.FontStyle S = System.Drawing.FontStyle.Regular;
                    if (FontBold) S |= System.Drawing.FontStyle.Bold;
                    if (FontItalic) S |= System.Drawing.FontStyle.Italic;
                    FFont = new System.Drawing.Font(FontName, (float)FontSize, S);
                }
                return (System.Drawing.Font)FFont.Clone(); // Vratim objekt
            }
            set
            {
                FFont = (System.Drawing.Font)ICore.DisposeObject(FFont); // Zrusim font
                FontName = value.Name;
                FontSize = value.Size;
                FontBold = value.Bold;
                FontItalic = value.Italic;
            }
        }
        /// <summary>Property: UseObject</summary>
        public bool UseObject
        {
            get
            {
                return UseFont || UseForeColor || UseBackColor || UseLook3D;
            }
        }
        /// <summary>Property: FontDisplayName</summary>
        public string FontDisplayName
        {
            get
            {
                string S = FontName + "  " + Math.Round(FontSize, 1).ToString().Replace(',', '.') + " pt  ";
                if (FontBold) S += "bold  ";
                if (FontItalic) S += "italic  ";
                return S.Trim().Replace("  ", ", ");
            }
        }

        /// <summary>Konstruktor</summary>
        public IVisualStyle()
        {
            FFont = null; // Inicializacia
            if (DefaultFontName == null)
            {
                DefaultFontName = System.Drawing.SystemFonts.DefaultFont.Name;
                DefaultFontSize = System.Drawing.SystemFonts.DefaultFont.Size;
            }
            Release(); // Inicializujem
        }
        /// <summary>Metoda dispose</summary>
        public void Dispose()
        {
            Release(); // Uvolnenie objektu
        }

        /// <summary>Uvolnenie objektu</summary>
        public void Release()
        {
            FFont = (System.Drawing.Font)ICore.DisposeObject(FFont); // Zrusim font
            FontName = DefaultFontName; // Inicializujem parametre
            FontSize = DefaultFontSize;
            FontBold = FontItalic = false;
            BackColor = System.Drawing.SystemColors.ButtonFace;
            ForeColor = System.Drawing.SystemColors.WindowText;
            Look3D = false;
            UseFont = false;
            UseBackColor = false;
            UseForeColor = false;
            UseLook3D = false;
        }
        /// <summary>Skopirovanie obsahu objektu</summary>
        /// <param name="pValue">objekt pre skopirovanie</param>
        public void Assign(IVisualStyle pValue)
        {
            Release();
            FontName = pValue.FontName; // Skopirujem parametre
            FontSize = pValue.FontSize;
            FontBold = pValue.FontBold;
            FontItalic = pValue.FontItalic;
            BackColor = pValue.BackColor;
            ForeColor = pValue.ForeColor;
            Look3D = pValue.Look3D;
            UseFont = pValue.UseFont;
            UseBackColor = pValue.UseBackColor;
            UseForeColor = pValue.UseForeColor;
            UseLook3D = pValue.UseLook3D;
        }
        /// <summary>Aplikovanie stylu na control</summary>
        /// <param name="pControl">control</param>
        public void Apply(System.Windows.Forms.Control pControl)
        {
            if (UseFont) pControl.Font = Font;
            if (UseBackColor) pControl.BackColor = BackColor;
            if (UseForeColor) pControl.ForeColor = ForeColor;
        }
        /// <summary>Skombinovanie s inym objektom</summary>
        /// <param name="pValue">objekt</param>
        public void Combine(IVisualStyle pValue)
        {
            if (pValue.UseBackColor) // Pouzit back color?
            {
                BackColor = pValue.BackColor;
                UseBackColor = true;
            }
            if (pValue.UseForeColor) // Pouzit fore color?
            {
                ForeColor = pValue.ForeColor;
                UseForeColor = true;
            }
            if (pValue.UseLook3D) // Pouzit 3D vzhlad?
            {
                Look3D = pValue.Look3D;
                UseLook3D = true;
            }
            if (pValue.UseFont) // Pouzit font?
            {
                FFont = (System.Drawing.Font)ICore.DisposeObject(FFont); // Zrusim font
                FontName = pValue.FontName; // Inicializujem parametre
                FontSize = pValue.FontSize;
                FontBold = pValue.FontBold; FontItalic = pValue.FontItalic;
                UseFont = true;
            }
        }
        /// <summary>Editacia klav. skratky pomocou formulara</summary>
        /// <param name="pCaption">nadpis okna</param>
        /// <param name="pCanEditFont">priznak povolenej editacie pisma</param>
        /// <param name="pCanEditForeColor">priznak povolenej editacie farby pisma</param>
        /// <param name="pCanEditBackColor">priznak povolenej editacie farby pozadia</param>
        /// <param name="pCanEdit3DLook">priznak povolenej editacie 3D vzhladu</param>
        /// <returns>true / false</returns>
        public bool EditWithForm(string pCaption, bool pCanEditFont = true, bool pCanEditForeColor = true, bool pCanEditBackColor = true, bool pCanEdit3DLook = true)
        {
            using (IForm_EditVisualStyle F = new IForm_EditVisualStyle())
            {
                F.Text = pCaption; F.CanEditFont = pCanEditFont; F.CanEditBackColor = pCanEditBackColor; F.CanEditForeColor = pCanEditForeColor; F.CanEdit3DLook = pCanEdit3DLook;
                F.Value.Assign(this); // Ulozim hodnotu
                bool B = F.ShowDialog() == System.Windows.Forms.DialogResult.OK; // Zobrazim okno
                if (B) Assign(F.Value); // Potvrdena hodnota?
                return B; // Vratim priznak potvrdenia
            }
        }

        /// <summary>Nastavenie fontu</summary>
        /// <param name="pName">nazov</param>
        /// <param name="pSize">velkost</param>
        /// <param name="pBold">priznak boldu</param>
        /// <param name="pItalic">priznak italic</param>
        public void SetFont(string pName, double pSize, bool pBold = false, bool pItalic = false)
        {
            FFont = (System.Drawing.Font)ICore.DisposeObject(FFont); // Zrusim font
            FontName = pName; // Inicializujem parametre
            FontSize = pSize;
            FontBold = pBold; FontItalic = pItalic;
            UseFont = true;
        }
        /// <summary>Nastavenie farby pozadia</summary>
        /// <param name="pValue">hodnota</param>
        public void SetBackColor(System.Drawing.Color pValue)
        {
            BackColor = pValue;
            UseBackColor = true;
        }
        /// <summary>Nastavenie farby pisma</summary>
        /// <param name="pValue">hodnota</param>
        public void SetForeColor(System.Drawing.Color pValue)
        {
            ForeColor = pValue;
            UseForeColor = true;
        }
        /// <summary>Nastavenie pouzitia</summary>
        /// <param name="pUseFont">priznak pouzitia fontu</param>
        /// <param name="pUseForeColor">priznak pouzitia farby pisma</param>
        /// <param name="pUseBackColor">priznak pouzitia farby pozadia</param>
        /// <param name="pUseLook3D">priznak pouzitia 3D vzhladu</param>
        public void SetUsable(bool pUseFont = false, bool pUseForeColor = false, bool pUseBackColor = false, bool pUseLook3D = false)
        {
            UseFont = pUseFont;
            UseBackColor = pUseBackColor;
            UseForeColor = pUseForeColor;
            UseLook3D = pUseLook3D;
        }
    }

    /// <summary>Trieda IVisualTheme</summary>
    public class IVisualTheme : IDisposable
    {
        public IVisualStyle AppFont;
        public IVisualStyle AppBoldFont;

        public IVisualStyle FileExplorer_UpStatus_Active;
        public IVisualStyle FileExplorer_UpStatus_InActive;
        public IVisualStyle FileExplorer_DownStatus_Active;
        public IVisualStyle FileExplorer_DownStatus_InActive;

        public IVisualStyle FileExplorer_List_DefaultItem;
        public IVisualStyle FileExplorer_List_Cursor;
        public IVisualStyle FileExplorer_List_Directory;
        public IVisualStyle FileExplorer_List_File;
        public IVisualStyle FileExplorer_List_ArchiveItem;
        public IVisualStyle FileExplorer_List_CompressedItem;
        public IVisualStyle FileExplorer_List_EncryptedItem;
        public IVisualStyle FileExplorer_List_HiddenItem;
        public IVisualStyle FileExplorer_List_ReadOnlyItem;
        public IVisualStyle FileExplorer_List_SystemItem;
        public IVisualStyle FileExplorer_List_SelectedItem;

        /// <summary>Konstruktor</summary>
        public IVisualTheme()
        {
            AppFont = new IVisualStyle(); // Vytvorim objekty
            AppBoldFont = new IVisualStyle();

            FileExplorer_UpStatus_Active = new IVisualStyle();
            FileExplorer_UpStatus_InActive = new IVisualStyle();
            FileExplorer_DownStatus_Active = new IVisualStyle();
            FileExplorer_DownStatus_InActive = new IVisualStyle();
            FileExplorer_List_DefaultItem = new IVisualStyle();
            FileExplorer_List_Cursor = new IVisualStyle();
            FileExplorer_List_Directory = new IVisualStyle();
            FileExplorer_List_File = new IVisualStyle();
            FileExplorer_List_ArchiveItem = new IVisualStyle();
            FileExplorer_List_CompressedItem = new IVisualStyle();
            FileExplorer_List_EncryptedItem = new IVisualStyle();
            FileExplorer_List_HiddenItem = new IVisualStyle();
            FileExplorer_List_ReadOnlyItem = new IVisualStyle();
            FileExplorer_List_SystemItem = new IVisualStyle();
            FileExplorer_List_SelectedItem = new IVisualStyle();
        }
        /// <summary>Dispose metoda</summary>
        public void Dispose()
        {
            AppFont = (IVisualStyle)ICore.DisposeObject(AppFont); // Zrusim objekty
            AppBoldFont = (IVisualStyle)ICore.DisposeObject(AppBoldFont);
            FileExplorer_UpStatus_Active = (IVisualStyle)ICore.DisposeObject(FileExplorer_UpStatus_Active);
            FileExplorer_UpStatus_InActive = (IVisualStyle)ICore.DisposeObject(FileExplorer_UpStatus_InActive);
            FileExplorer_DownStatus_Active = (IVisualStyle)ICore.DisposeObject(FileExplorer_DownStatus_Active);
            FileExplorer_DownStatus_InActive = (IVisualStyle)ICore.DisposeObject(FileExplorer_DownStatus_InActive);
            FileExplorer_List_DefaultItem = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_DefaultItem);
            FileExplorer_List_Cursor = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_Cursor);
            FileExplorer_List_Directory = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_Directory);
            FileExplorer_List_File = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_File);
            FileExplorer_List_ArchiveItem = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_ArchiveItem);
            FileExplorer_List_CompressedItem = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_CompressedItem);
            FileExplorer_List_EncryptedItem = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_EncryptedItem);
            FileExplorer_List_HiddenItem = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_HiddenItem);
            FileExplorer_List_ReadOnlyItem = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_ReadOnlyItem);
            FileExplorer_List_SystemItem = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_SystemItem);
            FileExplorer_List_SelectedItem = (IVisualStyle)ICore.DisposeObject(FileExplorer_List_SelectedItem);
        }

        /// <summary>Uvolnenie z pamate</summary>
        public void Release()
        {
            AppFont.Release(); // Uvolnim objekty
            AppBoldFont.Release();
            FileExplorer_UpStatus_Active.Release();
            FileExplorer_UpStatus_InActive.Release();
            FileExplorer_DownStatus_Active.Release();
            FileExplorer_DownStatus_InActive.Release();
            FileExplorer_List_DefaultItem.Release();
            FileExplorer_List_Cursor.Release();
            FileExplorer_List_Directory.Release();
            FileExplorer_List_File.Release();
            FileExplorer_List_ArchiveItem.Release();
            FileExplorer_List_CompressedItem.Release();
            FileExplorer_List_EncryptedItem.Release();
            FileExplorer_List_HiddenItem.Release();
            FileExplorer_List_ReadOnlyItem.Release();
            FileExplorer_List_SystemItem.Release();
            FileExplorer_List_SelectedItem.Release();
        }
        /// <summary>Skopirovanie obsahu objektu</summary>
        /// <param name="pValue">objekt pre skopirovanie</param>
        public void Assign(IVisualTheme pValue)
        {
            AppFont.Assign(pValue.AppFont);
            AppBoldFont.Assign(pValue.AppBoldFont);
            FileExplorer_UpStatus_InActive.Assign(pValue.FileExplorer_UpStatus_InActive);
            FileExplorer_DownStatus_InActive.Assign(pValue.FileExplorer_DownStatus_InActive);
            FileExplorer_UpStatus_Active.Assign(pValue.FileExplorer_UpStatus_Active);
            FileExplorer_DownStatus_Active.Assign(pValue.FileExplorer_DownStatus_Active);
            FileExplorer_List_DefaultItem.Assign(pValue.FileExplorer_List_DefaultItem);
            FileExplorer_List_Cursor.Assign(pValue.FileExplorer_List_Cursor);
            FileExplorer_List_Directory.Assign(pValue.FileExplorer_List_Directory);
            FileExplorer_List_File.Assign(pValue.FileExplorer_List_File);
            FileExplorer_List_ArchiveItem.Assign(pValue.FileExplorer_List_ArchiveItem);
            FileExplorer_List_CompressedItem.Assign(pValue.FileExplorer_List_CompressedItem);
            FileExplorer_List_EncryptedItem.Assign(pValue.FileExplorer_List_EncryptedItem);
            FileExplorer_List_HiddenItem.Assign(pValue.FileExplorer_List_HiddenItem);
            FileExplorer_List_ReadOnlyItem.Assign(pValue.FileExplorer_List_ReadOnlyItem);
            FileExplorer_List_SystemItem.Assign(pValue.FileExplorer_List_SystemItem);
            FileExplorer_List_SelectedItem.Assign(pValue.FileExplorer_List_SelectedItem);
        }
        /// <summary>Editacia temy pomocou formulara</summary>
        /// <param name="pCaption">nadpis okna</param>
        /// <param name="Value">klav. skratka</param>
        /// <returns>true / false</returns>
        public bool EditWithForm()
        {
            using (IForm_EditVisualTheme F = new IForm_EditVisualTheme())
            {
                F.Value.Assign(this); // Ulozim hodnotu
                bool B = F.ShowDialog() == System.Windows.Forms.DialogResult.OK; // Zobrazim okno
                if (B) Assign(F.Value); // Potvrdena hodnota?
                return B; // Vratim priznak potvrdenia
            }
        }

        /// <summary>Nacitanie temy</summary>
        /// <param name="pID">ID temy</param>
        public void LoadTheme(int pID)
        {
            Release(); // Uvolnim z pamate

            switch (pID)
            {
                default: // Zakladna tema
                    {
                        AppFont.UseFont = true;
                        AppBoldFont.SetFont(AppFont.FontName, AppFont.FontSize, true, false);
                        FileExplorer_UpStatus_InActive.SetFont(AppFont.FontName, AppFont.FontSize, false, false); FileExplorer_UpStatus_InActive.SetBackColor(System.Drawing.SystemColors.ButtonFace);
                        FileExplorer_DownStatus_InActive.Assign(FileExplorer_UpStatus_InActive); FileExplorer_DownStatus_InActive.SetBackColor(System.Drawing.SystemColors.ButtonFace);
                        FileExplorer_UpStatus_Active.SetFont(FileExplorer_UpStatus_InActive.FontName, FileExplorer_UpStatus_InActive.FontSize, true, false); FileExplorer_UpStatus_Active.SetBackColor(System.Drawing.SystemColors.GradientActiveCaption);
                        FileExplorer_DownStatus_Active.Assign(FileExplorer_UpStatus_Active); FileExplorer_DownStatus_Active.SetBackColor(System.Drawing.SystemColors.GradientActiveCaption);
                        FileExplorer_List_DefaultItem.SetFont(AppFont.FontName, AppFont.FontSize); FileExplorer_List_DefaultItem.SetBackColor(System.Drawing.SystemColors.Window); FileExplorer_List_DefaultItem.SetForeColor(System.Drawing.SystemColors.WindowText);
                        FileExplorer_List_Cursor.Assign(FileExplorer_List_DefaultItem); FileExplorer_List_Cursor.Look3D = true; FileExplorer_List_Cursor.SetUsable(false, false, false, true);
                        FileExplorer_List_Directory.Assign(AppBoldFont); FileExplorer_List_Directory.SetUsable(true, false, false, false);
                        FileExplorer_List_File.Assign(FileExplorer_List_DefaultItem); FileExplorer_List_File.SetUsable(false, false, false, false);
                        FileExplorer_List_ArchiveItem.Assign(FileExplorer_List_DefaultItem); FileExplorer_List_ArchiveItem.SetUsable(false, false, false, false);
                        FileExplorer_List_CompressedItem.Assign(FileExplorer_List_DefaultItem); FileExplorer_List_CompressedItem.SetForeColor(System.Drawing.Color.Blue); FileExplorer_List_CompressedItem.SetUsable(false, true, false, false);
                        FileExplorer_List_EncryptedItem.Assign(FileExplorer_List_DefaultItem); FileExplorer_List_EncryptedItem.SetForeColor(System.Drawing.Color.Green); FileExplorer_List_EncryptedItem.SetUsable(false, true, false, false);
                        FileExplorer_List_ReadOnlyItem.Assign(FileExplorer_List_DefaultItem); FileExplorer_List_ReadOnlyItem.SetUsable(false, false, false, false);
                        FileExplorer_List_HiddenItem.Assign(FileExplorer_List_DefaultItem); FileExplorer_List_HiddenItem.SetForeColor(System.Drawing.Color.Silver); FileExplorer_List_HiddenItem.SetUsable(false, true, false, false);
                        FileExplorer_List_SystemItem.Assign(FileExplorer_List_HiddenItem);
                        FileExplorer_List_SelectedItem.Assign(FileExplorer_List_DefaultItem); FileExplorer_List_SelectedItem.SetForeColor(System.Drawing.Color.Red); FileExplorer_List_SelectedItem.SetUsable(false, true, false, false);
                    } break;
            }
        }

        /// <summary>Prevod ID stylu na ID skupiny</summary>
        /// <param name="pID">ID stylu</param>
        /// <returns>ID skupiny</returns>
        public static int ID2GroupID(int pID)
        {
            switch (pID)
            {
                case VISUAL_STYLE_ID_FILE_EXPLORER_UP_STATUS_ACTIVE:
                case VISUAL_STYLE_ID_FILE_EXPLORER_UP_STATUS_INACTIVE:
                case VISUAL_STYLE_ID_FILE_EXPLORER_DOWN_STATUS_ACTIVE:
                case VISUAL_STYLE_ID_FILE_EXPLORER_DOWN_STATUS_INACTIVE:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_DEFAULT:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_DIRECTORY:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_FILE:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_ARCHIVE_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_COMPRESSED_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_ENCRYPTED_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_HIDDEN_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_READONLY_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_SYSTEM_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_SELECTED_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_CURSOR:
                    return VISUAL_STYLE_GROUP_ID_FILE_EXPLORER;
                default: return VISUAL_STYLE_GROUP_ID_COMMON;
            }
        }
        /// <summary>Prevod ID stylu na ID podskupiny</summary>
        /// <param name="pID">ID stylu</param>
        /// <returns>ID skupiny</returns>
        public static int ID2SubgroupID(int pID)
        {
            switch (pID)
            {
                case VISUAL_STYLE_ID_FILE_EXPLORER_UP_STATUS_ACTIVE:
                case VISUAL_STYLE_ID_FILE_EXPLORER_UP_STATUS_INACTIVE:
                case VISUAL_STYLE_ID_FILE_EXPLORER_DOWN_STATUS_ACTIVE:
                case VISUAL_STYLE_ID_FILE_EXPLORER_DOWN_STATUS_INACTIVE:
                    return VISUAL_STYLE_SUBGROUP_ID_FILE_EXPLORER_COMMON;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_DEFAULT:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_DIRECTORY:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_FILE:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_ARCHIVE_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_COMPRESSED_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_ENCRYPTED_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_HIDDEN_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_READONLY_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_SYSTEM_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_SELECTED_ITEM:
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_CURSOR:
                    return VISUAL_STYLE_SUBGROUP_ID_FILE_EXPLORER_LIST;
                default: return VISUAL_STYLE_SUBGROUP_ID_COMMON_COMMON;
            }
        }
        /// <summary>Prevod ID skupiny na popis</summary>
        /// <param name="pID">ID skupiny</param>
        /// <returns>popis skupiny</returns>
        public static string GroupID2Str(int pID)
        {
            switch (pID)
            {
                case VISUAL_STYLE_GROUP_ID_COMMON: return lang.VISUAL_STYLE_GROUP_ID_COMMON_TEXT;
                case VISUAL_STYLE_GROUP_ID_FILE_EXPLORER: return lang.VISUAL_STYLE_GROUP_ID_FILE_EXPLORER_TEXT;
                default: return "";
            }
        }
        /// <summary>Prevod ID podskupiny na popis</summary>
        /// <param name="pID">ID podskupiny</param>
        /// <returns>popis podskupiny</returns>
        public static string SubgroupID2Str(int pID)
        {
            switch (pID)
            {
                case VISUAL_STYLE_SUBGROUP_ID_COMMON_COMMON: return lang.VISUAL_STYLE_SUBGROUP_ID_COMMON_COMMON_TEXT;
                case VISUAL_STYLE_SUBGROUP_ID_FILE_EXPLORER_COMMON: return lang.VISUAL_STYLE_SUBGROUP_ID_FILE_EXPLORER_COMMON_TEXT;
                case VISUAL_STYLE_SUBGROUP_ID_FILE_EXPLORER_LIST: return lang.VISUAL_STYLE_SUBGROUP_ID_FILE_EXPLORER_LIST_TEXT;
                default: return "";
            }
        }
        /// <summary>Prevod ID stylu na popis</summary>
        /// <param name="pID">ID stylu</param>
        /// <returns>popis funkcie</returns>
        public static string ID2Str(int pID)
        {
            switch (pID)
            {
                case VISUAL_STYLE_ID_FILE_EXPLORER_UP_STATUS_ACTIVE: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_UP_STATUS_ACTIVE_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_UP_STATUS_INACTIVE: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_UP_STATUS_INACTIVE_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_DOWN_STATUS_ACTIVE: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_DOWN_STATUS_ACTIVE_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_DOWN_STATUS_INACTIVE: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_DOWN_STATUS_INACTIVE_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_DEFAULT: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_DEFAULT_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_DIRECTORY: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_DIRECTORY_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_FILE: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_FILE_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_ARCHIVE_ITEM: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_ARCHIVE_ITEM_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_COMPRESSED_ITEM: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_COMPRESSED_ITEM_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_ENCRYPTED_ITEM: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_ENCRYPTED_ITEM_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_HIDDEN_ITEM: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_HIDDEN_ITEM_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_READONLY_ITEM: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_READONLY_ITEM_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_SYSTEM_ITEM: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_SYSTEM_ITEM_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_SELECTED_ITEM: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_SELECTED_ITEM_TEXT;
                case VISUAL_STYLE_ID_FILE_EXPLORER_LIST_CURSOR: return lang.VISUAL_STYLE_ID_FILE_EXPLORER_LIST_CURSOR_TEXT;
                default: return "";
            }
        }
        /// <summary>Test moznosti nastavenia stylu</summary>
        /// <param name="pID">ID</param>
        /// <returns>true / false</returns>
        public static bool CanEdit(int pID)
        {
            switch (pID)
            {
                case IVisualTheme.VISUAL_STYLE_ID_APP_FONT:
                    return false;
                default: return true;
            }
        }
        /// <summary>Test ci skupina ma polozky</summary>
        /// <param name="pGroupID">ID skupiny</param>
        /// <returns>true / false</returns>
        public static bool GroupHasItems(int pGroupID)
        {
            for (int i = 0; i < VISUAL_STYLE_ID_LAST; i++)
            {
                if (!CanEdit(i)) continue;
                if (ID2GroupID(i) == pGroupID) return true; // Nasiel som?
            }
            return false; // Ziadne polozky
        }

        public const int VISUAL_STYLE_ID_APP_FONT = 0;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_UP_STATUS_ACTIVE = 1;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_UP_STATUS_INACTIVE = 2;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_DOWN_STATUS_ACTIVE = 3;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_DOWN_STATUS_INACTIVE = 4;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_DEFAULT = 5;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_DIRECTORY = 6;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_FILE = 7;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_ARCHIVE_ITEM = 8;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_COMPRESSED_ITEM = 9;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_ENCRYPTED_ITEM = 10;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_HIDDEN_ITEM = 11;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_READONLY_ITEM = 12;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_SYSTEM_ITEM = 13;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_SELECTED_ITEM = 14;
        public const int VISUAL_STYLE_ID_FILE_EXPLORER_LIST_CURSOR = 15;
        public const int VISUAL_STYLE_ID_LAST = 16;


        public const int VISUAL_STYLE_GROUP_ID_COMMON = 0;
        public const int VISUAL_STYLE_GROUP_ID_FILE_EXPLORER = 1;
        public const int VISUAL_STYLE_GROUP_ID_LAST = 2;

        public const int VISUAL_STYLE_SUBGROUP_ID_COMMON_COMMON = 0;
        public const int VISUAL_STYLE_SUBGROUP_ID_FILE_EXPLORER_COMMON = 1;
        public const int VISUAL_STYLE_SUBGROUP_ID_FILE_EXPLORER_LIST = 2;
    }
}
